import http from "@/utils/request";
//1.轮播
export function getForumListAPI() {
	return http.request({
		url: "forum/index",
		method: "get",
	});
}
//2.论坛详情
export function getForumDetailByIdAPI(id) {
	return http.request({
		url: "forum/detail",
		method: "get",
		params: {
			id
		},
	});

}
//3.查询论坛详情全部的评论
export function getForumReviewByIdAPI(id) {
	return http.request({
		url: "forum/review",
		method: "get",
		params: {
			id
		},
	});
}
//=============================
//4.取消评论点赞点赞
// 参数名         参数说明
// ids  多个编号(流水号)，用","分割"
export function deleteLikeForumAPI(ids)
{
	return http.request({
		url: "forum/cancellike",
		method: "get",
		params: {
			ids
		},
	});
}

//==============================
//5.论坛详情评论点赞
// 参数名         参数说明
// review_id
export function addLikeForumAPI(params)
{
	return http.request({
		url: "forum/addlike",
		method: "post",
		data: params,
	});
}
//6. 查询论坛详情全部的评论的是否点赞和点赞数量
export function getForumReviewIslikeByIdAPI(id) {
	return http.request({
		url: "forum/searchislike",
		method: "get",
		params: {
			id
		},
	});
}
//7.查询我的评论
export function getForumMyReviewByIdAPI(id) {
	return http.request({
		url: "forum/myreview",
		method: "get",
		params: {
			id
		},
	});
}
//8.查询论坛评价的详情
export function getForumReviewContentByIdAPI(params) {
	return http.request({
		url: "forum/reviewcontent",
		method: "post",
		data: params,
	});
}

//==============================
//9.删除评论
// 参数名         参数说明
// id  评论编号
export function deleteForumReviewAPI(ids)
{
	return http.request({
		url: "forum/deletereview",
		method: "get",
		params: {
			ids
		},
	});
}

//==============================
//10.更新评论
// 参数名         参数说明
// id  评论编号
export function updateForumReviewAPI(params)
{
	return http.request({
		url: "forum/updatereview",
		method: "post",
		data:params,
	});
}
//11.查询要修改的我的评论的信息
export function detailUpdateForumReviewAPI(id)
{
	return http.request({
		url: "forum/detailupdatereview",
		method: "get",
		params: {
			id
		},
	});
}

//12.图片发表
export function uploadPicAPI(file) {
	let formData = new FormData();
	formData.append("pic", file.file);
	return http.post("/upload/pic", formData, {
		headers: {
			'enctype': 'multipart/form-data'
		},
	});
}

//=============================
//13.取消关注（可以删除多条记录）
// 参数名         参数说明
// ids  多个编号(流水号)，用","分割"
export function deleteConcernForumItemAPI(ids)
{
	return http.request({
		url: "forum/deleteconcern",
		method: "get",
		params: {
			ids
		},
	});
}
//14.查询is_checked
export function ischeckedForumAPI(params)
{
	return http.request({
		url: "forum/select",
		method: "post",
		data: params,
	});
}

//==============================
//15.添加关注
// 参数名         参数说明
// product_id   商品编号
export function addConcernForumAPI(params)
{
	return http.request({
		url: "forum/addconcern",
		method: "post",
		data: params,
	});
}
//16.查询论坛封面的关注
export function forumSearchConcernListAPI()
{
	return http.request({
		url: "forum/searchconcern",
		method: "get",
	});
}
//17. 获取关注的论坛的评论
export function reviewConcernForumAPI()
{
	return http.request({
		url: "forum/reviewconcern",
		method: "get",
	});
}
//18. 获取点赞了的评论的id
export function searchReviewConcernForumAPI()
{
	return http.request({
		url: "forum/searchreviewconcern",
		method: "get",
	});
}
// 19.搜索用户关注的论坛
export function searchConcernForumAPI()
{
	return http.request({
		url: "forum/searchconcernforum",
		method: "get",
	});
}
// 20.查询这条论坛评价的详情
export function getforwardAPI(id) {
	return http.request({
		url: "forum/forward",
		method: "get",
		params: {
			id
		},
	});
}
// 11.查询论坛评价的评价
export function getReviewReviewAPI(id) {
	return http.request({
		url: "forum/reviewreview",
		method: "get",
		params: {
			id
		},
	});
}
//12.发表评论的评论
export function getPublishReviewAPI(params) {
	return http.request({
		url: "forum/publishreview",
		method: "post",
		data: params,
	});
}
//==============================
//13.删除评论的评论
// 参数名         参数说明
// id  评论编号
export function deleteReviewReviewAPI(ids)
{
	return http.request({
		url: "forum/deletereviewreview",
		method: "get",
		params: {
			ids
		},
	});
}

//==============================
//14.更新评论的评论
// 参数名         参数说明
// id  评论编号
export function updateReviewReviewAPI(params)
{
	return http.request({
		url: "forum/updatereviewreview",
		method: "get",
		params: params
	});
}
//15.查询要修改的评论的评论详情
export function updatereviewreviewdetailAPI(id)
{
	return http.request({
		url: "forum/updatereviewreviewdetail",
		method: "get",
		params:{id}
	});
}
